package com.heima.wemedia.config;

import com.heima.common.exception.CustException;
import com.heima.model.common.enums.AppHttpCodeEnum;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AOPConfig {
    @Around("@annotation(check)")
    public void method(ProceedingJoinPoint pjp,ab check){
        Object[] args = pjp.getArgs();
        if (args == null){
            CustException.cust(AppHttpCodeEnum.PARAM_INVALID);
        }
    }
}
